/*
 * @Author: 何 海深 813936564@qq.com
 * @Date: 2022-08-10 21:00:44
 * @LastEditors: 何 海深 813936564@qq.com
 * @LastEditTime: 2023-03-01 17:33:01
 * @FilePath: \show-data-vue3\src\api\index.ts
 * @Description:
 */
const modulesFiles: any = import.meta.glob('./modules/*Api.ts', {
  eager: true
})
const modules = Object.keys(modulesFiles).reduce(
  (modules: { [key: string]: any }, path: string) => {
    const moduleName = path.replace(/^\.\/modules\/(.*)\.\w+$/, '$1')
    modules[moduleName] = modulesFiles[path]?.default
    return modules
  },
  {}
)

// console.log(modules.homeApi.getUser);
export default modules
